<?php

require_once 'AbstractService.php';
require_once __DIR__ . "/../lib/Constant.php";

/**
 * 购买域名创建订单
 * Class CreateOrderService
 * time 2020/11/11 12:48
 * author zrone <xujining415@gmail.com>
 * copyright zrone <xujining415@gmail.com>
 */
class CreateOrderService extends AbstractService
{
    public function __invoke(array $logicParams)
    {
        $result = $this->terminal($logicParams, 'CreateOrder');
        if (isset($result["OrderID"])) {
            echo "域名购买成功";
        } elseif (isset($result['Code'])) {
            echo isset(Constant::CREATE_ORDER_ERROR[$result['Code']]) ? Constant::CREATE_ORDER_ERROR[$result['Code']] : '未定义的错误';
        } else {
            echo "请求失败，请刷新重试!";
        }
    }
}